//  this library.
/// 登录返回的tokenModel
class TokenModel {
  String? createdTime;
  String? modifyTime;
  String? createdBy;
  String? modifyBy;
  String? id;
  int? userType;
  String? name;
  String? mobile;
  String? header;
  String? sex;
  String? apiRoleName;
  String? userStatus;
  String? haveType;
  String? otherRoles;
  String? token;
  String? data;
  List<String>? userTypes;
  List<dynamic>? haveTypes;

  TokenModel({
    this.createdTime,
    this.modifyTime,
    this.createdBy,
    this.modifyBy,
    this.id,
    this.userType,
    this.name,
    this.mobile,
    this.header,
    this.sex,
    this.apiRoleName,
    this.userStatus,
    this.haveType,
    this.otherRoles,
    this.token,
    this.data,
    this.userTypes,
    this.haveTypes,
  });

  TokenModel.fromJson(Map<String, dynamic> json) {
    createdTime = json['createdTime'];
    modifyTime = json['modifyTime'];
    createdBy = json['createdBy'];
    modifyBy = json['modifyBy'];
    id = json['id'];
    userType = json['userType'];
    name = json['name'];
    mobile = json['mobile'];
    header = json['header'];
    sex = json['sex'];
    apiRoleName = json['apiRoleName'];
    userStatus = json['userStatus'];
    haveType = json['haveType'];
    otherRoles = json['otherRoles'];
    token = json['token'];
    data = json['data'];
    userTypes = json['userTypes'].cast<String>();
    if (json['haveTypes'] != null) {
      haveTypes = <dynamic>[];
      json['haveTypes'].forEach((v) {
        haveTypes!.add(v);
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['createdTime'] = createdTime;
    data['modifyTime'] = modifyTime;
    data['createdBy'] = createdBy;
    data['modifyBy'] = modifyBy;
    data['id'] = id;
    data['userType'] = userType;
    data['name'] = name;
    data['mobile'] = mobile;
    data['header'] = header;
    data['sex'] = sex;
    data['apiRoleName'] = apiRoleName;
    data['userStatus'] = userStatus;
    data['haveType'] = haveType;
    data['otherRoles'] = otherRoles;
    data['token'] = token;
    data['data'] = data;
    data['userTypes'] = userTypes;
    if (haveTypes != null) {
      data["haveTypes"] = [];
      for (var element in haveTypes!) {
        data["haveTypes"].add(element);
      }
    }
    return data;
  }
}
